/*! 20230315.5-RELEASE */

function _typeof(t){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){var e="idproviders",r="INTENT_IQ",o="https://cdn.taboola.com/scripts/IIQUniversalID.js",i=359446293,n=.01;try{t.TRC.intentIq={init:function e(){if(this.sampleLogs=Math.random()<n,this.log("init"),t&&t.TRC||this.logError("missing-trc"),t.TRC.intentIqInitialized)this.logError("already-init");else{try{t&&t.localStorage&&t.localStorage.getItem&&"function"==typeof t.localStorage.getItem?this.loadIntentIq():this.logError("no-storage")}catch(t){this.logError("storage")}t.TRC.intentIqInitialized=!0}},loadIntentIq:function t(){this.log("loading");try{this.loadScript(o,this.onScriptLoaded.bind(this),this.logError.bind(this,"script"))}catch(t){this.logError("load")}},onScriptLoaded:function e(){if(t.IntentIqObject){this.log("loaded");var r=this.logDefined("tuid",this.getUserId()),o=this.logDefined("meta",this.getMetaData());this.logMetaData(o),this.log("request"),this.timingStart=+new Date,this.iiq=new t.IntentIqObject({partner:i,refreshInMillis:432e5,timeoutInMillis:3e3,isAsyncServerRequest:!0,callback:this.onData.bind(this),enhanceRequests:!1,sourceMetaData:o,mode:"Both",partnerClientId:r,partnerClientIdType:0})}else this.logError("missing-obj")},onData:function t(e){this.log("timing",+new Date-this.timingStart),"object"===_typeof(e)&&e?(this.log("response"),this.log("size",Object.keys(e).length),this.storeProviderIds(r,e)):this.logError("response")},storeProviderIds:function r(o,i){this.log("storing");var n=this.getExistingProviderIds();n[o]=i;try{this.log("setting"),t.localStorage.setItem(e,t.JSON.stringify(n)),this.log("set")}catch(t){this.logError("set")}},logMetaData:function t(e){e&&("string"!=typeof e?this.logError("bad-meta"):"0.0.0.0"===e&&this.logError("masked-meta"))},getExistingProviderIds:function r(){try{var o=t.localStorage.getItem(e)||"{}";return t.JSON.parse(o)}catch(t){return this.logError("existing"),{}}},loadScript:function e(r,o,i){var n=document.createElement("script");n.src=r,n.onload=o,n.onerror=i,t.document.head.appendChild(n)},getUserId:function t(){return this.getTrcUserId()||this.getTfaUserId()},getTfaUserId:function e(){return t.TFASC&&t.TFASC.tfaUserId&&"function"==typeof t.TFASC.tfaUserId.getUserId?t.TFASC.tfaUserId.getUserId():null},getTrcUserId:function e(){return t.TRC.pageManager&&"function"==typeof t.TRC.pageManager.getUserId?t.TRC.pageManager.getUserId():null},getMetaData:function e(){return t.TRC.unmaskedIpParser&&t.TRC.unmaskedIpParser.get()||void 0},logError:function t(e){this.log("error",e)},logDefined:function t(e,r){return this.log(e,!!r),r},log:function t(e,r){this.sampleLogs&&(r&&(r={extraData:{value:r}}),TRC.RBoxUsage.logUsage("iiq.".concat(e),r))}},t.TRC.intentIq.init()}catch(t){__trcError("Error running Intent IQ",t)}}(window);